package com.dx.wx.controller;

import com.dx.wx.service.DxNewsService;
import com.ejlchina.data.Array;
import com.yf.response.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

@RestController
@RequestMapping("/api/dx/news")
public class ApiDxNewsController {


    @GetMapping("/sale")
    public R saleList(String appId){
        Array array = dxNewsService.findAct(appId);
        return R.ok(array.toString());
    }

    @GetMapping("/act")
    public R actList(){
        Array array = dxNewsService.findSale();
        return R.ok(array.toString());
    }

    @GetMapping("/lottery")
    public R lotteryList(){
        Array array = dxNewsService.findLottery();
        return R.ok(array.toString());
    }

    @Autowired
    private DxNewsService dxNewsService;

}
